/**
 * Created by wuli等等 on 2017/3/2.
 */
import React, { Component, PropTypes } from 'react';
import { View, Text,StyleSheet ,TouchableOpacity ,Button} from 'react-native';


export default class CancleBtn extends Component {
    _pressCancle = () =>{
        const { navigator } = this.props;
        if(navigator) {
            //很熟悉吧，入栈出栈~ 把当前的页面pop掉，这里就返回到了上一个页面:FirstPageComponent了
            navigator.pop();
        }
    }

    render() {
        const { text } = this.props;
        return (
            <TouchableOpacity  onPress={this._pressCancle} >
                <Text style={styles.buttonText}>{text}</Text>
            </TouchableOpacity>

        )
    }
}
const styles=StyleSheet.create({
    buttonText:{
        textAlign:'center',
        color:'black'
    },

});